﻿<%@ Page Title="" Language="C#" MasterPageFile="~/iFrameMasterPage.master" AutoEventWireup="true" CodeFile="DiscountEditor.aspx.cs" Inherits="DiscountListEditor" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">
<table width ="100%" cellpadding ="1" cellspacing ="1" >
    <tr >
        <td style ="width :20px" >            
            <asp:Image ID="Image1" ImageUrl ="~/images/Calendar_scheduleHS.png" runat="server" />
        </td>
        <td style ="text-align :left;font-weight :bold"  >
            Дисконтная программа
        </td>
        <td style ="text-align :center;font-weight :bold;"  >
            <asp:Label ID="Label4" CssClass="msgAlert" style="display :none "  runat="server" Text="Сохраните изменения"></asp:Label>
        </td>
        <td style ="text-align :right " >
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                            <ContentTemplate>
                                                <asp:LinkButton ID="LinkButton1" onclick="btnSaveExit_Click" runat="server" CssClass="btn">Сохранить/Вернуться</asp:LinkButton>                                                
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
        </td>
    </tr>
</table>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" Runat="Server">
 <div class="TblCaption" 
                onclick="CaptionToggle('body_CommonInfo','Caption_CommonInfo');" 
                style="width:100%; height :25px">
                <table style="width:100%;">
                    <tr>
                        <td ID="Caption_CommonInfo" class="ArrowDown">
                            &nbsp;</td>
                        <td>
                            Общая информация &nbsp;                            
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
            </div>
 <div ID="body_CommonInfo" style="width:100%">
                <table cellpadding="0" cellspacing="0" style="width:100%;">
                    <tr ID="trCommonInfo">
                        <td width="25%">
                            <table cellpadding="2" cellspacing="0" style="width:100%;">
                                <%--GID--%>
                                <tr>
                                    <td width="25%">
                                        &nbsp;</td>
                                    <td class="grd_td_item_caption" style="width:25%">
                                        Наименование:
                                        <asp:RequiredFieldValidator ID="txtNameValidator1" runat="server" 
                                            ControlToValidate="txtName" ErrorMessage="*"></asp:RequiredFieldValidator>
                                    </td>
                                    <td class="grd_td_item">
                                        <asp:TextBox ID="txtName" runat="server" CssClass="RequiredTextBox" Text =<%# Discount.Name %>
                                            Width="99%"></asp:TextBox>
                                    </td>
                                </tr>                                
                                <tr>
                                    <td width="25%">
                                        &nbsp;</td>
                                    <td class="grd_td_item_caption" style="width:25%">
                                        Тип:</td>
                                    <td class="grd_td_item">
                                        <asp:RadioButton ID="RadioButton1" runat="server" Checked="True" GroupName="ww" 
                                            Text="Скидка" />
                                        <asp:RadioButton ID="rbIsCharge" runat="server" GroupName="ww" 
                                            Text="Начисление" />
                                    </td>
                                </tr>
                                <tr>
                                    <td width="25%">
                                        &nbsp;</td>
                                    <td class="grd_td_item_caption" style="width:25%">
                                        Сроки:</td>
                                    <td class="grd_td_item">
                                        <table cellpadding="2px" cellspacing="0" style="width:100%;" width="100%">
                                            <tr>
                                                <td style="width :75px">
                                                    Начало:</td>
                                                <td style="width:90px">
                                                    <asp:TextBox ID="txt_dtStart" runat="server" CssClass="RequiredTextBox" 
                                                     Text =<%#  Discount.dtStart.ToShortDateString() %>   ></asp:TextBox>
                                                     <cc1:CalendarExtender Format="dd.MM.yyyy" ID="txt_dtCreate_CalendarExtender" runat="server" 
                                                        Enabled="True" TargetControlID="txt_dtStart">
                                                    </cc1:CalendarExtender>
                                                </td>
                                                <td style="text-align:right">
                                                    Окончание:</td>
                                                <td style="width:90px">
                                                    <asp:TextBox ID="txt_dtFinish" runat="server" CssClass="RequiredTextBox" 
                                                       Text=<%# Discount.dtFinish.ToShortDateString()%>  ></asp:TextBox>
                                                    <cc1:CalendarExtender Format="dd.MM.yyyy" ID="txt_dtCreate_CalendarExtender1" runat="server" 
                                                        Enabled="True" PopupPosition ="BottomRight"  TargetControlID="txt_dtFinish">
                                                    </cc1:CalendarExtender>
                                                </td>
                                                <td style="width:1px">
                                                    &nbsp;</td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="25%">
                                        &nbsp;</td>
                                    <td class="grd_td_item_caption" style="width:25%">
                                        Величина %:<asp:RegularExpressionValidator ID="RegularExpressionValidator2" 
                                            runat="server" ControlToValidate="txtPercent" ErrorMessage="*" 
                                            ValidationExpression="([0-9]{1,3})"></asp:RegularExpressionValidator>
                                    </td>
                                    <td class="grd_td_item">
                                        <asp:TextBox ID="txtPercent" runat="server" CssClass="RequiredTextBox" 
                                            Text="<%# Discount.Percent %>" Width="99%"></asp:TextBox>
                                            <cc1:MaskedEditExtender ID="me_txtGRP"
                                            Mask="99"
                                            runat="server"
                                            MessageValidatorTip="true" 
                                            OnFocusCssClass="MaskedEditFocus" 
                                            OnInvalidCssClass="MaskedEditError"
                                            MaskType="Number" 
                                            InputDirection="LeftToRight"      
                                            AcceptNegative="Left"                       
                                            ErrorTooltipEnabled="True"                     
                                            TargetControlID="txtPercent"
                                            ClearTextOnInvalid ="false">                     
                                            </cc1:MaskedEditExtender>
                                            <cc1:MaskedEditValidator                 
                                            ControlExtender="me_txtGRP"
                                            ControlToValidate="txtPercent" 
                                            IsValidEmpty="true"  
                                            MaximumValue="99" 
                                            EmptyValueMessage="Введите число 0-100"
                                            InvalidValueMessage="Неверное значение"
                                            MaximumValueMessage="Значение > 0"
                                            MinimumValueMessage="Значение < 1"
                                            MinimumValue="0" 
                                            EmptyValueBlurredText="*" 
                                            InvalidValueBlurredMessage="*" 
                                            MaximumValueBlurredMessage="*" 
                                            MinimumValueBlurredText="*"
                                            Display="Dynamic" 
                                            TooltipMessage="Введите число: 0-100"                
                                            ID="mev_txtGRP" runat="server"></cc1:MaskedEditValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="vertical-align :top " width="25%">
                                    </td>
                                    <td class="grd_td_item_caption" style="width:25%;vertical-align :top">
                                        Дополнительно:</td>
                                    <td class="grd_td_item">
                                        <asp:TextBox ID="txtComment" runat="server" CssClass="TextBox" Height="47px" 
                                             Text =<%# Discount.Description %> TextMode="MultiLine" Width="99%"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="25%">
                                        &nbsp;</td>
                                    <td style="width:25%">
                                        &nbsp;</td>
                                    <td style="text-align :right ">
                                        <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                                            <ContentTemplate>
                                                <asp:Button ID="btnSaveCommonInfo" runat="server" CssClass="btn_wizard" 
                                                     Text="Сохранить" onclick="btnSaveCommonInfo_Click" 
                                                    onclientclick="skm_LockScreen();"  />
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
</asp:Content>

